<?php

/*
 * This file is part of the php-phantomjs.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace lemon\phantomjs;

use lemon\phantomjs\Http\RequestInterface;
use lemon\phantomjs\Http\ResponseInterface;

/**
 * PHP PhantomJs
 *
 * @author Jon Wenmoth <contact@jonnyw.me>
 */
interface ClientInterface
{
	/**
	 * Get singleton instance
	 *
	 * @access public
	 * @return \lemon\phantomjs\ClientInterface
	 */
	public static function getInstance();

	/**
	 * Get engine instance.
	 *
	 * @access public
	 * @return \lemon\phantomjs\Engine
	 */
	public function getEngine();

	/**
	 * Get message factory instance
	 *
	 * @access public
	 * @return \lemon\phantomjs\Http\MessageFactoryInterface
	 */
	public function getMessageFactory();

	/**
	 * Get procedure loader instance
	 *
	 * @access public
	 * @return \lemon\phantomjs\Procedure\ProcedureLoaderInterface
	 */
	public function getProcedureLoader();

	/**
	 * Send request
	 *
	 * @access public
	 * @param \lemon\phantomjs\Http\RequestInterface  $request
	 * @param \lemon\phantomjs\Http\ResponseInterface $response
	 */
	public function send(RequestInterface $request, ResponseInterface $response);

	/**
	 * Get log.
	 *
	 * @access public
	 * @return string
	 */
	public function getLog();

	/**
	 * Set procedure template.
	 *
	 * @access public
	 * @param  string $procedure
	 * @return void
	 */
	public function setProcedure($procedure);

	/**
	 * Get procedure template.
	 *
	 * @access public
	 * @return string
	 */
	public function getProcedure();

	/**
	 * Set lazy request flag.
	 *
	 * @access public
	 * @return void
	 */
	public function isLazy();
}
